package com.github.ecbp.common.exception.user;


import com.github.ecbp.common.api.ResultCode;

public class NotLoginException extends RuntimeException {

    private ResultCode resultCode;

    public static NotLoginException create(String message) {
        NotLoginException instance = new NotLoginException(message);
        instance.setResultCode(ResultCode.UNAUTHORIZED);
        return instance;
    }

    public ResultCode getResultCode() {
        return resultCode;
    }

    public void setResultCode(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public NotLoginException() {

    }

    public NotLoginException(String message) {
        super(message);
    }

    public NotLoginException(String message, Throwable cause) {
        super(message, cause);
    }

    public NotLoginException(Throwable cause) {
        super(cause);
    }

    public NotLoginException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public void doThrow() {
        throw this;
    }
}
